<!DOCTYPE html>
<html>
<head th:include="cultivateWeb/header :: culHeaderCss">
</head>
<link type="text/css" href="/css/cultivateWeb/style/news.css" rel="stylesheet">
<link type="text/css" href="/css/cultivateWeb/style/teach.css" rel="stylesheet">
<body>
<!-- 顶部导航 -->
<header th:include="cultivateWeb/header :: header"></header>
<div style="clear: both"></div>
<div style="background-color: #f7f7f7; ">
    <div class="layui-container">
        <p style="line-height: 40px">当前位置：<a href="/cultivate/homepage">首页</a> > 信息查询</p>
    </div>
    <div class="div1">
        <!--<a href="#"><span class="news cx" a="0">师资查询</span></a>-->
        <a href="#"><span class="news cx" a="1">机构查询</span></a>
    </div>
    <div style="background-color: #f7f7f7; width: 1200px; margin: 0 auto">
        <div style="margin: 20px auto 20px 30px">
            <select id="type"  class="form-control query_1">
                <option value="0" selected>培训机构</option>
                <option value="1">实训机构</option>
                <option value="3">实习就业单位</option>
            </select>
            <input type="text" id="orgName" placeholder="机构名称" class="form-control query_1" />
            <input type="button" onclick="findOrg();" value="搜素" class="but" />
        </div>
        <div style="margin-bottom: 50px; display: inline-block">

            <!-- 培训机构查询 -->
            <section  id="px" style="padding:0px;background:#f7f7f7 ">
                <div id="jg"></div>
                <div id="page1" class="page"></div>
            </section>
            <div style="clear: both"></div>
        </div>
    </div>
</div>

<!-- footer ------------------------------------------------------- -->
<div class="footer" th:include="cultivateWeb/header :: footer"></div>
<script type="text/javascript" src="/js/xlPaging.js"></script>
</body>
<script>

    //-----------------------机构查询--------------------------//
    findOrg();
function findOrg(){
    $.ajax({
        url:'/jzApi/organizion/selExaminationPoint',
        data:{
            name:$("#orgName").val() ,
            type:$("#type").val(),
            current:1 ,
            number:10
        },
        success:function (r) {
            if(r.data.pages==0){
                $("#jg").html('<div class="noData">暂无数据</div>');
            }else{
                var list = r.data.records;
                var news = '';
                list.forEach(function (item, index) {
                    var a='';
                    if($("#type").val()==0){
                        a='培训机构'
                    }
                    if($("#type").val()==1){
                        a='实训机构'
                    }
                    if($("#type").val()==3){
                        a='实习就业单位'
                    }
                    news += '<div class="tea_1" id="js" style="padding: 10px 0px">'+
                        '<div id="sz">' +
                        '<div class="tea_3" style="margin-top: 10px;width:455px;">机构名称：'+item.name+'('+a+')</div>' +
                        '<div class="tea_4" style="width:455px;">机构地址：'+item.address+'</div>' +
                        '<div class="tea_4" style="width:455px;">机构联系人：'+item.contacts+'</div>' +
                        '<div class="tea_4" style="width:455px;">联系人手机号：'+item.mobile+'</div>' +
                        '<div class="tea_4" style="width:455px;">负责证书：'+item.profileName+'</div>' +
                        '</div></div>';
                });
                news +='<div style="clear: both"></div>';
                $("#jg").html(news);
                page(1,r.data.pages,$("#name").val(), $("#type").val());
            }
        }
    })
}

function page(num,tolPages ,name,type) {
    $("#page1").paging({
        nowPage:Number(num), // 当前页码
        pageNum:Number(tolPages), // 总页码
        buttonNum:10, //要展示的页码数量
        canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
        showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
        callback: function (num) { //回调函数
            $.ajax({
                url: '/jzApi/organizion/selExaminationPoint',
                type: 'GET',
                data: {
                    type:type,
                    name:name,
                    current: num,
                    number:10
                },
                success:function (res) {
                    var list = res.data.records;
                    var news = '';
                    list.forEach(function (item, index) {
                        news += '<div class="tea_1" id="js">'+
                            '<div id="sz">' +
                            '<div class="tea_3" style="margin-top: 10px;width:455px;">机构名称：'+item.name+'('+a+')</div>' +
                            '<div class="tea_4" style="width:455px;">机构地址：'+item.address+'</div>' +
                            '<div class="tea_4" style="width:455px;">机构联系人：'+item.contacts+'</div>' +
                            '<div class="tea_4" style="width:455px;">联系人手机号：'+item.mobile+'</div>' +
                            '<div class="tea_4" style="width:455px;">负责证书：'+item.profileName+'</div>' +
                            '</div></div>';
                    });
                    news +='<div style="clear: both"></div>';
                    $("#jg").html(news);
                }
            });
        }
    });
}

</script>
</html>